package com.stars.easyms.logger.support.logback;

import ch.qos.logback.classic.LoggerContext;
import com.stars.easyms.logger.EasyMsLogger;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;

/**
 * <p>className: EasyMsLogbackLoggerContext</p>
 * <p>description: EasyMs的日志上下文</p>
 *
 * @author guoguifang
 * @date 2019-08-15 22:37
 * @since 1.3.0
 */
public final class EasyMsLogbackLoggerContext implements ILoggerFactory {

    private LoggerContext loggerContext;

    public EasyMsLogbackLoggerContext(LoggerContext loggerContext) {
        this.loggerContext = loggerContext;
    }

    @Override
    public Logger getLogger(String name) {
        return new EasyMsLogger(loggerContext.getLogger(name));
    }

    public LoggerContext getLoggerContext() {
        return loggerContext;
    }
}